package group2assignone.ucm;

import group2assignone.dao.ClientComms;
import group2assignone.view.MainView;
import group2assignone.view.OurView;

/**
 * Use Case to logout a user that is logged in
 * @author group2
 */
public class UCLogout implements UCController {

    private OurView view;

    public UCLogout(OurView view) {
        this.view = view;
    }

    /**
     * Use Case: Log Out
     * 1. system exits current view
     * 2. system updates gui to the main view
     */
    public void run() {
        ClientComms client = UCStartup.getInstance().getClientComms();
        client.logout();
        MainView gui = new MainView();
        gui.go();
        view.dispose();
    }
}
